#选择完英雄时挂在天上
execute as @a[tag=DieOutSelectFinish] at @s run tp @s ~ 200 ~

#将拥有DieOutSelectFinish标签的玩家人数记录在AlivePlayerCount中
execute store success score AlivePlayerCount DieOutInfo if entity @a[tag=DieOutSelectFinish]

#若AlivePlayerCount = OnlinePlayerCount 所有玩家选择完毕时，快速进入下一阶段
execute if score TimeClock DieOutInfo matches 7.. if score AlivePlayerCount DieOutInfo = OnlinePlayerCount System run scoreboard players set TimeClock DieOutInfo 6
execute if score TimeClock DieOutInfo matches 7.. if score AlivePlayerCount DieOutInfo = OnlinePlayerCount System run scoreboard players set DieOutSelectHeroTiming System 5
execute if score TimeClock DieOutInfo matches 7.. if score AlivePlayerCount DieOutInfo = OnlinePlayerCount System run tellraw @a [{"text":"[大逃杀] ","color":"red","bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"所有玩家已选择完毕，即将在","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"DieOutInfo","name":"TimeClock"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s 后启动大逃杀对局","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]

#当TimeClock为0时，且有两个以上玩家时，创建对局
execute if score TimeClock DieOutInfo matches 0 if score AlivePlayerCount DieOutInfo matches 2.. run scoreboard players set IsTheDieOutGame SystemAdmin 3
# execute if score TimeClock DieOutInfo matches 0 run scoreboard players set IsTheDieOutGame SystemAdmin 3

##若没有玩家选择英雄，或只有一人选择，则结束游戏————————————————————————————————————————————————————
execute if score TimeClock DieOutInfo matches 0 if score AlivePlayerCount DieOutInfo matches ..1 run tellraw @a [{"text":"[大逃杀] ","color":"red","bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"对局人数不足，当前人数：","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"DieOutInfo","name":"AlivePlayerCount"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 本次对局结束","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
execute if score TimeClock DieOutInfo matches 0 if score AlivePlayerCount DieOutInfo matches ..1 run function nw:system/system_module/dieout_util_gameover
# execute if score TimeClock DieOutInfo matches 0 if score AlivePlayerCount DieOutInfo matches ..0 run tellraw @a [{"text":"[大逃杀] ","color":"red","bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"对局人数不足，当前人数：","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"DieOutInfo","name":"AlivePlayerCount"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 本次对局结束","color":"white","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
# execute if score TimeClock DieOutInfo matches 0 if score AlivePlayerCount DieOutInfo matches ..0 run function nw:system/system_module/dieout_util_gameover